﻿namespace KinonekoSoftware.CodariaDB.Documents
{
    public sealed class InstanceEngine : _Full<Instance>
    {

        public bool Has(string id)=> InsideDB.HasID(id);
        public Instance Get(string id) => InsideDB.FindById(id);
        public override string GetCollectionName() => CollectionNames.InstanceDB;
        
        public void AddInstance(Instance instance)
        {
            if (instance is null)
            {
                return;
            }

            Modified();
            InsideDB.Insert(instance);
        }
        
        
        public void UpdateInstance(Instance instance)
        {
            if (instance is null)
            {
                return;
            }

            Modified();
            InsideDB.Update(instance);
        }
        
        public override string EngineID => EngineNames.Instance;

    }
}